1. Field
This disclosure relates generally to addressing in a data processing system, and more specifically, to a method for implementing bit-reversed addressing in a data processing system.
2. Related Art
Many types of filtering algorithms, such as in digital signal processing (DSP) applications, utilize buffers to hold sets of input samples and computed output samples from a set of filtering operations, such as Fast Fourier Transform (FFT) filters. These filters are typically accessed in a bit-reversed fashion to obtain the data and store outputs in a predetermined order which corresponds to the natural order of computations. For example, for an 8 element FFT buffer having elements 0, 1, 2, 3, 4, 5, 6, and 7 stored in a linear order, the bit-reversed order in which they need to be accessed is elements 0, 4, 2, 6, 1, 5, 3, and 7.
A bit reversed increment (brinc) instruction available today to support accessing FFT data in a bit-reversed manner provides, as its result, an index that is updated with bit-reversed addressing. The brinc instruction may have a format of “brinc rD, rA, rB” where rA contains the index into a buffer that contains data on which FFT is to be performed, rB contains a mask that allows the index to be updated with bit-reversed incrementing, and rD stores the resulting updated index with bit-reversed increment. This brinc instruction typically precedes a load with index instruction (e.g. Ihax) which uses the resulting index to perform a load of the FFT data. However, a load with index instruction requires the use of three general purpose registers (GPRs). For example, this load instruction typically takes the form of “Ihax rD, rA, rB” where rA contains a base address, rB contains an index value, and rD receives the data loaded from the address location addressed by “the base address+the index value”. Therefore, the result of the brinc instruction can then be used as the index value of a subsequent load with index instruction to obtain the next FFT data element in the proper bit-reversed order. However, in many cases, the use of FFT filters appears in sections of code which rely heavily on the use of numerous GPRs, where the use of such load with index instructions necessary to load the FFT data may reduce efficiency of accessing FFT data.